/**
 * CopyRight © 2012 USTC SINOVATE SOFTWARE CO.LTD All Rights Reserved.
 */

package com.cmcc.zysoft.infocollection.service;

import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.cmcc.zysoft.infocollection.dao.IndustryPcDao;
import com.cmcc.zysoft.infocollection.model.Industry;
import com.starit.common.dao.hibernate.HibernateBaseDao;
import com.starit.common.dao.service.BaseServiceImpl;

/**
 * @author 袁凤建
 * <br />邮箱: yuan.fengjian@ustcinfo.com
 * <br />描述: IndustryService.java
 * <br />版本: 1.0.0
 * <br />日期: 2013-8-14 下午4:04:22
 * <br />CopyRight © 2012 USTC SINOVATE SOFTWARE CO.LTD All Rights Reserved.
 */

@Service
public class IndustryPcService extends BaseServiceImpl<Industry, String> {

	@Resource
	private IndustryPcDao industryPcDao;
	
	@Override
	public HibernateBaseDao<Industry, String> getHibernateBaseDao() {
		return this.industryPcDao;
	}
	
	/**
	 * 获取行业分页列表信息.
	 * @param page
	 * @param rows
	 * @param keyword 搜索关键字
	 * @return map
	 */
	public Map<String, Object> getIndustryList(int page, int rows, String keyword) {
		return this.industryPcDao.getIndustryList(page, rows, keyword);
	}
	
	/**
	 * 检查行业名称是否已经存在.
	 * @param industryName 行业名称
	 * @param industryId 行业ID
	 * @return Boolean(true:存在,false-不存在)
	 */
	public Boolean check(String industryName, String industryId) {
		List<Map<String, Object>> list = this.industryPcDao.check(industryName, industryId);
		if(list.isEmpty()) {
			return false;
		}
		return true;
	}
	
	/**
	 * 根据频道ID查找行业列表信息.
	 * @param channelId 频道ID
	 * @return List<Map<String, Object>>
	 */
	public List<Map<String, Object>> industrys(String channelId) {
		return this.industryPcDao.industrys(channelId);
	}
}